package com.ndood.article.dao;

import com.ndood.article.pojo.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
public interface ArticleDao extends JpaRepository<Article,String>,JpaSpecificationExecutor<Article>{

	/**
	 * 1.2.42 文章审核
	 */
	@Modifying
	@Query("update Article set state='1' where id=?1")
	public void examine(String id);

	/**
	 * 1.2.45 文章点赞
	 */
	@Modifying
	@Query("update Article set thumbup=thumbup+1 where id=?1")
	public void updateThumbup(String id);

}
